use std::path;
use std::str;
-use support::{ResultTest, project, execs, main_file, escape_path, basic_bin_manifest};
+use support::{ResultTest, project, execs, main_file, basic_bin_manifest};
use support::{COMPILING, RUNNING};
use hamcrest::{assert_that, existing_file};
use cargo;
p = p
.file(".cargo/config", format!(r#"
- paths = ["{}"]
- "#, escape_path(&bar)).as_slice())
+ paths = ['{}']
+ "#, bar.display()).as_slice())
.file("Cargo.toml", r#"
[project]
p = p
.file(".cargo/config", format!(r#"
- paths = ["{}", "{}"]
- "#, escape_path(&bar), escape_path(&baz)).as_slice())
+ paths = ['{}', '{}']
+ "#, bar.display(), baz.display()).as_slice())
.file("Cargo.toml", r#"
[project]
p = p
.file(".cargo/config", format!(r#"
- paths = ["{}", "{}"]
- "#, escape_path(&bar), escape_path(&baz)).as_slice())
+ paths = ['{}', '{}']
+ "#, bar.display(), baz.display()).as_slice())
.file("Cargo.toml", r#"
[project]
p = p
.file(".cargo/config", format!(r#"
- paths = ["{}", "{}"]
- "#, escape_path(&bar), escape_path(&baz)).as_slice())
+ paths = ['{}', '{}']
+ "#, bar.display(), baz.display()).as_slice())
.file("Cargo.toml", r#"
[project]
p = p
.file(".cargo/config", format!(r#"
- paths = ["{}", "{}"]
- "#, escape_path(&bar), escape_path(&baz)).as_slice())
+ paths = ['{}', '{}']
+ "#, bar.display(), baz.display()).as_slice())
.file("Cargo.toml", r#"
[project]
name = "foo"
version = "0.5.0"
authors = ["wycats@example.com"]
- build = "{}"
+ build = '{}'
[[bin]] name = "foo"
- "#, escape_path(&build.bin("foo"))))
+ "#, build.bin("foo").display()))
.file("src/foo.rs", r#"
fn main() {}
"#);
name = "foo"
version = "0.5.0"
authors = ["wycats@example.com"]
- build = [ "{} hello world", "{} cargo" ]
+ build = [ '{} hello world', '{} cargo' ]
[[bin]] name = "foo"
- "#, escape_path(&build1.bin("foo")), escape_path(&build2.bin("bar"))))
+ "#, build1.bin("foo").display(), build2.bin("bar").display()))
.file("src/foo.rs", r#"
fn main() {}
"#);
name = "foo"
version = "0.5.0"
authors = ["wycats@example.com"]
- build = "{}"
+ build = '{}'
[[bin]]
name = "foo"
- "#, escape_path(&build.bin("foo"))))
+ "#, build.bin("foo").display()))
.file("src/foo.rs", r#"
fn main() {}
"#);
name = "foo"
version = "0.5.0"
authors = ["wycats@example.com"]
- build = [ "{}", "{}" ]
+ build = [ '{}', '{}' ]
[[bin]]
name = "foo"
- "#, escape_path(&build1.bin("foo")), escape_path(&build2.bin("bar"))))
+ "#, build1.bin("foo").display(), build2.bin("bar").display()))
.file("src/foo.rs", r#"
fn main() {}
"#);
.file("src/foo.rs", format!(r#"
use std::os;
fn main() {{
- assert_eq!(os::getenv("OUT_DIR").unwrap(), "{}".to_string());
- assert_eq!(os::getenv("DEPS_DIR").unwrap(), "{}".to_string());
+ assert_eq!(os::getenv("OUT_DIR").unwrap(), r"{}".to_string());
+ assert_eq!(os::getenv("DEPS_DIR").unwrap(), r"{}".to_string());
}}
"#,
- escape_path(&p.root().join("target")),
- escape_path(&p.root().join("target").join("deps"))));
+ p.root().join("target").display(),
+ p.root().join("target").join("deps").display()));
assert_that(build.cargo_process("cargo-build"), execs().with_status(0));
name = "foo"
version = "0.5.0"
authors = ["wycats@example.com"]
- build = "{}"
+ build = '{}'
[[bin]]
name = "foo"
- "#, escape_path(&build.bin("foo"))))
+ "#, build.bin("foo").display()))
.file("src/foo.rs", r#"
fn main() {}
"#);
.file("src/foo.rs", format!(r#"
use std::os;
fn main() {{
- assert_eq!(os::getenv("OUT_DIR").unwrap(), "{}".to_string());
- assert_eq!(os::getenv("DEPS_DIR").unwrap(), "{}".to_string());
+ assert_eq!(os::getenv("OUT_DIR").unwrap(), r"{}".to_string());
+ assert_eq!(os::getenv("DEPS_DIR").unwrap(), r"{}".to_string());
}}
"#,
- escape_path(&p.root().join("target/deps")),
- escape_path(&p.root().join("target/deps"))));
+ p.root().join("target/deps").display(),
+ p.root().join("target/deps").display()));
assert_that(build.cargo_process("cargo-build"), execs().with_status(0));
p = p
.file(".cargo/config", format!(r#"
- paths = ["{}"]
- "#, escape_path(&bar)).as_slice())
+ paths = ['{}']
+ "#, bar.display()).as_slice())
.file("Cargo.toml", r#"
[project]
name = "bar"
version = "0.5.0"
authors = ["wycats@example.com"]
- build = "{}"
- "#, escape_path(&build.bin("foo"))))
+ build = '{}'
+ "#, build.bin("foo").display()))
.file("bar/src/lib.rs", r#"
pub fn bar() {}
"#);
use std::io::File;
use support::{ProjectBuilder, ResultTest, project, execs, main_file, paths};
-use support::{escape_path, cargo_dir};
+use support::{cargo_dir};
use support::{COMPILING, FRESH, UPDATING};
use hamcrest::{assert_that,existing_file};
use cargo;
[dependencies.dep1]
- git = "file:{}"
+ git = 'file:{}'
[[bin]]
name = "foo"
- "#, escape_path(&git_project.root())))
+ "#, git_project.root().display()))
.file("src/foo.rs", main_file(r#""{}", dep1::hello()"#, ["dep1"]));
let root = project.root();
[dependencies.dep1]
- git = "file:{}"
+ git = 'file:{}'
branch = "branchy"
[[bin]]
name = "foo"
- "#, escape_path(&git_project.root())))
+ "#, git_project.root().display()))
.file("src/foo.rs", main_file(r#""{}", dep1::hello()"#, ["dep1"]));
let root = project.root();
[dependencies.dep1]
- git = "file:{}"
+ git = 'file:{}'
tag = "v0.1.0"
[[bin]]
name = "foo"
- "#, escape_path(&git_project.root())))
+ "#, git_project.root().display()))
.file("src/foo.rs", main_file(r#""{}", dep1::hello()"#, ["dep1"]));
let root = project.root();
[dependencies.dep1]
version = "0.5.0"
- git = "file:{}"
+ git = 'file:{}'
[[bin]]
name = "parent"
- "#, escape_path(&git_project.root())))
+ "#, git_project.root().display()))
.file("src/parent.rs",
main_file(r#""{}", dep1::hello()"#, ["dep1"]).as_slice());
[dependencies.dep1]
version = "0.5.0"
- git = "file:{}"
+ git = 'file:{}'
[dependencies.dep2]
version = "0.5.0"
- git = "file:{}"
+ git = 'file:{}'
[[bin]]
name = "parent"
- "#, escape_path(&git_project.root()), escape_path(&git_project.root())))
+ "#, git_project.root().display(), git_project.root().display()))
.file("src/parent.rs",
main_file(r#""{} {}", dep1::hello(), dep2::hello()"#, ["dep1", "dep2"]).as_slice());
authors = []
[dependencies.bar]
- git = "file:{}"
+ git = 'file:{}'
rev = "{}"
[dependencies.baz]
path = "../baz"
- "#, escape_path(&bar.root()), rev1.as_slice().trim()).as_slice())
+ "#, bar.root().display(), rev1.as_slice().trim()).as_slice())
.file("src/main.rs", r#"
extern crate bar;
extern crate baz;
authors = []
[dependencies.bar]
- git = "file:{}"
+ git = 'file:{}'
rev = "{}"
- "#, escape_path(&bar.root()), rev2.as_slice().trim()).as_slice())
+ "#, bar.root().display(), rev2.as_slice().trim()).as_slice())
.file("src/lib.rs", r#"
extern crate bar;
pub fn baz() -> int { bar::bar() }
[dependencies.bar]
version = "0.5.0"
- git = "file:{}"
+ git = 'file:{}'
[[bin]]
name = "foo"
- "#, escape_path(&git_project.root())))
+ "#, git_project.root().display()))
.file("src/foo.rs",
main_file(r#""{}", bar::bar()"#, ["bar"]).as_slice());
use std::io::File;
use std::io::timer;
-use support::{ResultTest, project, execs, main_file, escape_path, cargo_dir};
+use support::{ResultTest, project, execs, main_file, cargo_dir};
use support::{COMPILING, FRESH};
use hamcrest::{assert_that, existing_file};
use cargo;
let bar = p.root().join("bar");
p = p
.file(".cargo/config", format!(r#"
- paths = ["{}"]
- "#, escape_path(&bar)).as_slice())
+ paths = ['{}']
+ "#, bar.display()).as_slice())
.file("Cargo.toml", r#"
[project]
let baz = p.root().join("baz");
p = p
.file(".cargo/config", format!(r#"
- paths = ["{}", "{}"]
- "#, escape_path(&bar), escape_path(&baz)).as_slice())
+ paths = ['{}', '{}']
+ "#, bar.display(), baz.display()).as_slice())
.file("Cargo.toml", r#"
[project]
let baz = p.root().join("baz");
p = p
.file(".cargo/config", format!(r#"
- paths = ["{}", "{}"]
- "#, escape_path(&bar), escape_path(&baz)).as_slice())
+ paths = ['{}', '{}']
+ "#, bar.display(), baz.display()).as_slice())
.file("Cargo.toml", r#"
[project]